Repository navigation
fix(transcript): a past-the-end window resets to the char-budgeted tail; Electron heap report (#1475) - #1492
Merged
currentbits merged 2 commits intoOct 6, 2026
Conversation
…il (#1475) The store's retention cap drops ~100 messages from the front of a long thread, so a window start held while scrolled up (or unpinned) can land past the shorter timeline. clampWindowStart then reset it to the last 120 entries by count, skipping TRANSCRIPT_CHAR_BUDGET: in the Electron soak that mounted ~48k nodes of 45 KB answers in one push. Reset through tailWindowStart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urves (#1475) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1475 (deep dive into PM3's Electron-only renderer heap growth). The full write-up is
docs/perf/2026-10-06-electron-heap.md.Finding: the unbounded growth is not a bridge or IPC leak. It is the stick-to-bottom pin loss that #1491 fixed: a trim's
scrollTopclamp reads as the user scrolling up, so the window never trims again.In a 30-stream Electron soak on main before #1491, the pin was lost at stream 10:
With #1491, two 30-stream runs stayed pinned: heap 39–46 MB, DOM 12–13k and footprint 141–149 MB, flat from stream 6 to 30.
This PR's fix (
clampWindowStart): when the store's retention cap drops a long thread's head, an unpinned window whose start was past the new length used to reset to the last 120 entries regardless of size. That mounted 48k nodes at once in the soak. It now resets totailWindowStart, the character-budgeted tail.Where PM3's +12 MB came from (all of it bounded):
thread:updatedafter launch is a full 4 MB transcript, released by stream 6;PM3's "RSS peak 416 MB" was
psRSS noise; the vmmap footprint is the reliable number.Verified independently, on main merged with this branch
vite buildpasses.transcriptWindow.test.tscases fail on main (2 of 8).Safety: 18 Electron launches on the PM3 zero-leak recipe, each followed by a leak check, with no clone git writes and no
recovered/*. The halts were attributed to live activity: an orchestrator worktree, the #1491 push, and a botpoc commit.🤖 Generated with Claude Code